package com.probox.activity.api.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.probox.common.core.annotation.Excel;
import com.probox.common.core.enums.ActivityTypeEnum;
import com.probox.common.core.utils.money.PriceFormatUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("活动参与数据")
public class ActivityJoinVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "参与活动数据ID")
    private Long joinUid;

    /** 参与活动父级ID */
    @Excel(name = "参与活动父级ID")
    @ApiModelProperty(value = "参与活动父级ID(参与活动父级ID)")
    private Long joinPuid;

    /** 平台ID */
    @Excel(name = "平台ID")
    @ApiModelProperty(value = "平台ID(平台ID)")
    private Long platformUid;

    /** 活动ID */
    @Excel(name = "活动ID")
    @ApiModelProperty(value = "活动ID(活动ID)")
    private Long activityUid;

    /** 活动类型（bargain砍价/seckill秒杀/limittime限时/group拼团/free新人免费领/packages套餐/score积分兑换） */
    @Excel(name = "活动类型" , readConverterExp = "bargain砍价/seckill秒杀/limittime限时/group拼团/free新人免费领/packages套餐/score积分兑换")
    @ApiModelProperty(value = "活动类型(bargain砍价/seckill秒杀/limittime限时/group拼团/free新人免费领/packages套餐/score积分兑换)")
    private String activityType;

    /** 活动名称 */
    @Excel(name = "活动名称")
    @ApiModelProperty(value = "活动名称(活动名称)")
    private String activityName;

    /** 活动商品ID */
    @Excel(name = "活动商品ID")
    @ApiModelProperty(value = "活动商品ID(活动商品ID)")
    private Long activityProUid;

    /** 商品ID */
    @Excel(name = "商品ID")
    @ApiModelProperty(value = "商品ID(商品ID)")
    private Long proUid;

    /** 商品名称 */
    @Excel(name = "商品名称")
    @ApiModelProperty(value = "商品名称(商品名称)")
    private String proName;

    /** 商品图片 */
    @Excel(name = "商品图片")
    @ApiModelProperty(value = "商品图片(商品图片)")
    private String proImg;

    /** sku属性ID */
    @Excel(name = "sku属性ID")
    @ApiModelProperty(value = "sku属性ID(sku属性ID)")
    private Long skuUid;

    /** SKU名称 */
    @Excel(name = "SKU名称")
    @ApiModelProperty(value = "SKU名称(SKU名称)")
    private String skuName;

    /** 商品数量 */
    @Excel(name = "商品数量")
    @ApiModelProperty(value = "商品数量(商品数量)")
    private Integer proNumber;

    /** 客户ID */
    @Excel(name = "客户ID")
    @ApiModelProperty(value = "客户ID(客户ID)")
    private Long customerUid;

    /** 客户名称 */
    @Excel(name = "客户名称")
    @ApiModelProperty(value = "客户名称(客户名称)")
    private String customerName;

    /** 客户头像 */
    @Excel(name = "客户头像")
    @ApiModelProperty(value = "客户头像(客户头像)")
    private String customerUrl;

    /** 活动折扣(废弃) */
    @Excel(name = "活动折扣(废弃)")
    @ApiModelProperty(value = "活动折扣(废弃)(活动折扣(废弃))")
    private BigDecimal activityRate;

    /** 活动折扣后的价格 */
    @Excel(name = "活动折扣后的价格")
    @ApiModelProperty(value = "活动折扣后的价格(活动折扣后的价格)")
    private Long activityPrice;

    /** 成交价格 */
    @Excel(name = "成交价格")
    @ApiModelProperty(value = "成交价格(成交价格)")
    private Long buyPrice;

    /** 已砍金额 */
    @Excel(name = "已砍金额")
    @ApiModelProperty(value = "已砍金额(已砍金额)")
    private Long bargainAmount;

    /** 0:进行中/1:已付款/2：成交/-1:参与失败 */
    @Excel(name = "0:进行中/1:已付款/2：成交/-1:参与失败")
    @ApiModelProperty(value = "0:进行中/1:已付款/2：成交/-1:参与失败(0:进行中/1:已付款/2：成交/-1:参与失败)")
    private String dataStatus;

    /** 修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "修改时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /** 订单ID */
    @Excel(name = "订单ID")
    @ApiModelProperty(value = "订单ID")
    private Long orderUid;

    /** 过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "过期时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "过期时间")
    private Date expireDate;

    public String getActivityPriceStr(){
        return PriceFormatUtil.format(activityPrice);
    }

    public String getBuyPriceStr(){
        return PriceFormatUtil.format(buyPrice);
    }

    public String getBargainAmountStr(){
        return PriceFormatUtil.format(bargainAmount);
    }

    public String getActivityTypeName(){
        return ActivityTypeEnum.getNameByKey(activityType);
    }

}
